#ifndef YOOHOO_XMPPCORE_STANZAPARSER_H
#define YOOHOO_XMPPCORE_STANZAPARSER_H

#include "xmppcore/xmppparserfactory.h"

namespace yoohoo_xmppcore {

class Stanza;
class JabberId;

class StanzaParser : public XmppParser {
public:
	XmppObject* obj();
	bool processAttributes(QString path, QList<ParsingAttribute> attributes);
	bool processEmbeddedObject(ProtocolKey protocolKey, XmppObject* obj);

protected:
	virtual Stanza* stanza() = 0;
	virtual bool setType(QString sType) = 0;
	virtual bool doProcessAttributes(QString path, QList<ParsingAttribute> attributes);
	virtual bool doProcessEmbeddedObject(ProtocolKey protocolKeys, XmppObject* obj);

private:
	JabberId* parseJid(QString jid);

private:
	static const QString ATTRIBUTE_NAME_ID;
	static const QString ATTRIBUTE_NAME_TYPE;
	static const QString ATTRIBUTE_NAME_TO;
	static const QString ATTRIBUTE_NAME_FROM;
	static const QString ATTRIBUTE_NAME_LANG;
	static const QString PREFIX_XML;
};

}

#endif
